﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace robotGUI
{
    public partial class frmMdi : Form
    {
        MdiClient mdiClient;
        public frmMdi()
        {
            InitializeComponent();
            foreach (Control ctl in Controls)
                if (ctl.GetType() == typeof(MdiClient))
                    mdiClient = ctl as MdiClient;

        }

        frmDXTest dx;
        private void visualizerControlToolStripMenuItem_Click(object sender, EventArgs e)
        {
            dx = new frmDXTest();
            dx.MdiParent = this;
            //dx.FormBorderStyle = FormBorderStyle.None;
            //dx.Location = new Point(0, 0);
            //dx.Size = mdiClient.ClientSize;
            dx.Show();
        }

        private void frmMdi_Resize(object sender, EventArgs e)
        {
            //dx.Size = mdiClient.ClientSize;
            //dx.Invalidate();
        }

        private void joystickControlToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmJoyTest joy = new frmJoyTest();
            joy.MdiParent = this;
            joy.Show();
        }

        private void cascadeWindowsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void tileWindowsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void tileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void arrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }
    }
}
